<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_base_privilege".
 *
 * @property string $id ID
 * @property string $pid 父id
 * @property string $name 权限名称
 * @property string $url 路径
 * @property string $type 类型
 * @property string $note 备注
 * @property int $sequence 排序
 * @property string $create_by 创建者
 * @property string $create_time 创建时间
 * @property string $update_by 更新者
 * @property string $update_time 更新时间
 * @property int $del_flag 删除标示(0 false 1 true)
 * @property int $is_leaf 是否叶子节点(0 false 1 true)
 */
class TBasePrivilege extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_base_privilege';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['pid', 'sequence', 'create_by', 'update_by', 'del_flag', 'is_leaf'], 'integer'],
            [['name', 'url', 'note', 'sequence'], 'required'],
            [['create_time', 'update_time'], 'safe'],
            [['name'], 'string', 'max' => 32],
            [['url'], 'string', 'max' => 128],
            [['type'], 'string', 'max' => 64],
            [['note'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'pid' => 'Pid',
            'name' => 'Name',
            'url' => 'Url',
            'type' => 'Type',
            'note' => 'Note',
            'sequence' => 'Sequence',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'del_flag' => 'Del Flag',
            'is_leaf' => 'Is Leaf',
        ];
    }
}
